package me.sealer.java8.lambda;

import me.sealer.java8.lambda.io.BufferedReaderProcessor;
import me.sealer.java8.lambda.utils.IOUtil;

import java.io.BufferedReader;
import java.io.IOException;

/**
 * Created by sealer on 09-17-2017.
 */
public class Test {
    public static void main(String[] args) throws IOException {
        String s;
        BufferedReaderProcessor brp;
        String filePath = args[0];//从运行参数传入文件路径及名称


//        brp = (BufferedReader br) -> br.readLine();

        //不论有几个参数， 参数的类型是可以省掉的；若只有一个参数，可以省掉括号；没有参数小括号不能省
//        brp = br -> br.readLine();
        brp = BufferedReader::readLine;

        s = IOUtil.processFile(filePath, brp);
//        s = IOUtil.processFile(filePath, BufferedReader::readLine);
        System.out.println(s);
    }
}
